Remove hardcoded instances of TIMER_SLOP.
authorKeir Fraser <keir.fraser@citrix.com>
Wed, 10 Feb 2010 13:27:55 +0000 (13:27 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Wed, 10 Feb 2010 13:27:55 +0000 (13:27 +0000)
They aren't needed at all, since slop now only delays a timer firing,
rather than allowing it to happen early.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen/arch/ia64/vmx/vlsapic.c
xen/common/schedule.c

index b382e0b9c053278ac64089795781c1cf6e421219..39f59a7e8a71c072758d493e138a62d8aef8bea6 100644 (file)
@@ -242,7 +242,6 @@ void vtm_set_itc(VCPU *vcpu, uint64_t new_itc)
 }
 
 
-#define TIMER_SLOP (50*1000) /* ns */  /* copy from timer.c */
 extern u64 cycle_to_ns(u64 cyle);
 
 
@@ -258,7 +257,7 @@ void vtm_set_itm(VCPU *vcpu, uint64_t val)
         cur_itc = now_itc(vtm);
         if (time_before(val, cur_itc))
             val = cur_itc;
-        expires = NOW() + cycle_to_ns(val-cur_itc) + TIMER_SLOP;
+        expires = NOW() + cycle_to_ns(val-cur_itc);
         vmx_vcpu_unpend_interrupt(vcpu, ITV_VECTOR(vitv));
         set_timer(&vtm->vtm_timer, expires);
     }else{
index 8664de568e145c456b84b473ea88ec7d4ea661ff..600baeac05ef434450741553bc7bbe7244bb871e 100644 (file)
@@ -45,8 +45,6 @@ string_param("sched", opt_sched);
 int sched_smt_power_savings = 0;
 boolean_param("sched_smt_power_savings", sched_smt_power_savings);
 
-#define TIME_SLOP      (s32)MICROSECS(50)     /* allow time to slip a bit */
-
 /* Various timer handlers. */
 static void s_timer_fn(void *unused);
 static void vcpu_periodic_timer_fn(void *data);
@@ -775,8 +773,7 @@ static void vcpu_periodic_timer_work(struct vcpu *v)
 
     periodic_next_event = v->periodic_last_event + v->periodic_period;
 
-    /* The timer subsystem may call us up to TIME_SLOP ahead of deadline. */
-    if ( (now + TIME_SLOP) > periodic_next_event )
+    if ( now >= periodic_next_event )
     {
         send_timer_event(v);
         v->periodic_last_event = now;